<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@page import="java.text.SimpleDateFormat" %>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<TblOaNotice> list = (List<TblOaNotice>)request.getAttribute("list");
	NoticeForm form = (NoticeForm)request.getAttribute("command");
	SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
	String endDate = df.format(System.currentTimeMillis());
	String startDate = df.format(System.currentTimeMillis()-5L*24*60*60*1000);
	String tab = form.getTab();
	String group = StringUtils.isNotBlank(form.getGroup())?form.getGroup():Constants.NOTICE_GROUP_NOTICE;
	UserInfo user = (UserInfo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
%>
<div id="childLayout" class="easyui-layout" data-options="fit:true">
	<div data-options="region:'west',split:true,maxWidth:220,collapsible:true,style:{borderWidth:2},onResize:function(){XF.LAYOUT.resizeWest();}" style="background: #f7f7f9;width:220px;" title=" ">
		 <div class="sidebar">
			<div id="sidebar" class="easyui-accordion" style="width:auto;height:auto;">  
				<div title="公告"  style="overflow:auto;padding:10px;">  
					<ul class="site-ul">
					
						<sec:authorize ifAllGranted="READ_NOTICE">
							<li class="site-li">
								<a s="notice_0" href="javascript:XF.Notice.listNotice('0','','')"><span>查看公告</span></a>
							</li>
						</sec:authorize>	
						
						<sec:authorize ifAllGranted="VIEW_DUTY">
							<li class="site-li">
								<a s="duty_0" href="javascript:XF.Duty.listDuty('0')"><span>查看值班表</span></a>
							</li>
						</sec:authorize>
						
						<sec:authorize ifAllGranted="READ_DAILY">
							<li class="site-li">
								<a s="notice_1" href="javascript:XF.Notice.listNotice('1','','')"><span>营运日报</span></a>
							</li>
						</sec:authorize>
						<sec:authorize ifAllGranted="READ_DAILY">
							<li class="site-li">
								<a s="listDamaged" href="javascript:XF.Goods.listDamaged('','','<%=startDate %>','<%=endDate %>')"><span>查看破损件</span></a>
							</li>
							<li class="site-li">
								<a s="listUnknown" href="javascript:XF.Goods.listUnknown('<%=user.getSiteId() %>','<%=startDate %>','<%=endDate %>','','','','','2')"><span>查看不明件</span></a>
							</li>
						</sec:authorize>
						<sec:authorize ifAllGranted="ADD_NOTICE">
							<li class="site-li">
								<a s="addNotice_0" href="javascript:XF.Notice.addNotice('0')"><span>发布公告</span></a>
							</li>
						</sec:authorize>
						<sec:authorize ifAllGranted="ADD_DAILY">
							<li class="site-li">
								<a s="addNotice_1" href="javascript:XF.Notice.addNotice('1')"><span>发布营运日报</span></a>
							</li>
						</sec:authorize>
						<sec:authorize ifAnyGranted="EDIT_NOTICE,DELETE_NOTICE">
							<li class="site-li">
								<a s="listNotice_0" href="javascript:XF.Notice.managelistNotice('0')"><span>管理公告</span></a>
							</li>
						</sec:authorize>
						<sec:authorize ifAnyGranted="MANAGE_DUTY">
							<li class="site-li">
								<a s="duty_1" href="javascript:XF.Duty.manageDuty()"><span>管理值班表</span></a>
							</li>
						</sec:authorize>
						<sec:authorize ifAnyGranted="MANAGE_DUTY">
							<li class="site-li">
								<a s="schedule_0" href="javascript:XF.Duty.manageSchedule()"><span>管理值班班次</span></a>
							</li>
						</sec:authorize>
						<sec:authorize ifAnyGranted="EDIT_DAILY,DELETE_DAILY">
							<li class="site-li">
								<a s="listNotice_1" href="javascript:XF.Notice.managelistNotice('1')"><span>管理营运日报</span></a>
							</li>
						</sec:authorize>
						
						<li class="site-li">
							<a s="weekly_0" href="javascript:XF.Notice.listWeekly('0')"><span>信丰周刊</span></a>
						</li>
						
					</ul>
				</div>
			</div> 
		</div>
	</div>
	<div id="noticeCenter" class="settingCenter" data-options="region:'center'" >
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$('#childLayout').layout();
		XF.NAV.activeTab('"<%=tab%>"');
	    $('#sidebar').accordion({
	        animate:true
	    });
	    XF.Notice.listNotice("0","","");
	});
</script>